home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 637 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: ix.netcom.com!netnews
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Is this ok: *pointer++ = value ??
  5. Date: Mon, 08 Jan 1996 01:15:08 GMT
  6. Organization: Netcom
  7. Message-ID: <30f07002.168040256@nntp.ix.netcom.com>
  8. References: <4cklvv$nmm@alcor.usc.edu> <4cmmcd$e3u@gryphon.phoenix.net> <30eefb76.72646976@nntp.ix.netcom.com> <4cn97v$6on@fountain.mindlink.net>
  9. NNTP-Posting-Host: ix-dc14-09.ix.netcom.com
  10. X-NETCOM-Date: Sun Jan 07  5:14:50 PM PST 1996
  11. X-Newsreader: Forte Agent .99c/16.141
  12.  
  13. genew@mindlink.bc.ca (Gene Wirchenko) wrote:
  14.  
  15. |>miker3@ix.netcom.com (Mike Rubenstein) wrote:
  16. |>
  17. |>>brucew@phoenix.net (Bruce Wedding) wrote:
  18. |>
  19. |>>|>wawda@alcor.usc.edu (Abu Wawda) wrote:
  20. |>>|>
  21. |>>|>>    for (i=0; i<50; i++) *pointer++ = i;
  22. |>>|>
  23. |>>|>>My only problem is why? I mean you aren't allowed to do:
  24. |>>|>
  25. |>>|>>                 for (i=0; i<50; i++) p++ = i;
  26. |>>|>
  27. |>>|>Sure you can do that.  You are assigning addresses to the
  28. pointer.
  29. |>>It
  30. |>>|>probably isn't too smart, but it is legal.
  31. |>
  32. |>>In what language is it legal?  Certainly not C which requires a
  33. |>>modifiable lvalue as the right operand of = and defines p++ as not
  34. |>>being an lvalue.
  35. |>
  36. |>>Michael M Rubenstein
  37. |>
  38. |>     Bull!  The RIGHT operand requires an L-value?  Ha!  That would
  39. |>make:
  40. |>          int a;
  41. |>          a=2;
  42. |>illegal.
  43. |>     In the example above,
  44. |>          p
  45. |>is the L-value.  After being used as such, it is incremented.
  46. |>
  47. |>Sincerely,
  48. |>
  49. |>Gene Wirchenko
  50. |>
  51. |>C Pronunciation Guide:
  52. |>     y=x++;     "wye equals ex plus plus semicolon"
  53. |>     x=x++;     "ex equals ex doublecross semicolon"
  54. |>
  55.  
  56.  
  57. I was, of course, talking about Gimel, the Hebrew version of C :-)
  58.  
  59. Guess I still haven't learned to tell my left from my right.  I meant
  60. the left operand.
  61.  
  62.  
  63. Michael M Rubenstein
  64.